<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>芯佑电商_我的地址</title>
    <#include "/website/commonWebsite.html">
    <!--<link href="js/checkbox/checkbox.css" rel="stylesheet" type="text/css" />
    <script src="js/checkbox/checkbox.js"></script>-->
    <!--==弹出框==-->
    <script src="/website/js/popup/popup.js"></script>
    <link rel="stylesheet" href="/website/js/popup/common.css" type="text/css"/>
    <link rel="stylesheet" href="/website/js/popup/popup.css" type="text/css"/>
</head>
<body>

<!--==头部==-->
<div class="header">
    <#include "/website/header.html">
</div>

<!--==内容区域==-->
<div class="home_n">
    <div  class="home_nr">
        <!--==banner==-->
        <div class="medat-ba">会员中心</div>
        <!--==内容==-->
        <div class="medat-nr">
            <!--==左侧==-->
            <#include "/website/left.html">
            <!--==右侧==-->
            <div class="medat-nr-ri">
                <!--标题-->
                <div class="medat-nr-rib">我的地址</div>
                <!--地址-->
                <#if addressList?? && addressList?size &gt;0>
                <#list addressList as item>
                    <div class="meadd-lis">
                        <div class="meadd-lis-le">
                            <dl>
                                <dt>姓名：</dt>
                                <dd>${item.receiver_name}</dd>
                            </dl>
                            <dl>
                                <dt>电话：</dt>
                                <dd>${item.receiver_phone}</dd>
                            </dl>
                            <dl>
                                <dt>邮编：</dt>
                                <dd>${item.postal_code}</dd>
                            </dl>
                            <dl>
                                <dt>地区：</dt>
                                <dd>${item.receiver_province}${item.receiver_city}${item.receiver_county}</dd>
                            </dl>
                            <dl>
                                <dt>地址：</dt>
                                <dd>${item.receiver_address}</dd>
                            </dl>
                        </div>
                        <div class="meadd-lis-ri" onclick="addressDel('${item.pk}')"><a href="javascript:void(0)">删除</a></div>
                        <div class="meadd-lis-ri"><a href="/website/personalData/me_address_add?pk=${item.pk}">编辑</a></div>
                        <!--<div class="meadd-lis-ri box"><a href="javascript:;" class="bounceIn">编辑</a></div>-->
                    </div>
                </#list>
                </#if>
                <!--按钮-->
                <div class="meadd-an"><span><button type="button" onclick="location.href='/website/personalData/me_address_add'">添加新地址</button></span></div>
            </div>
        </div>
    </div>
</div>

<!--==弹出背景==-->
<div id="dialogBg" class="claseDialogBtn"></div>

<!--==弹出内容==-->
<div id="dialog" class="animated">
    <!--内容区域可以替换-->
    <div class="shoinf-addt">
        <div class="shoinf-addt-bt">添加新地址</div>
        <div class="shoinf-addt-nr">
            <div class="shoinf-addt-nra">
                <h1><strong>*</strong>地址信息：</h1>
                <div class="outer">
                    <select name="province" id="province">
                        <option value="请选择">请选择</option>
                    </select>
                    <select name="city" id="city">
                        <option value="请选择">请选择</option>
                    </select>
                    <select name="town" id="town">
                        <option value="请选择">请选择</option>
                    </select>
                </div>
            </div>
            <div class="shoinf-addt-nra">
                <h1><strong>*</strong>详细地址：</h1>
                <p><textarea placeholder="请输入详细地址信息，如道路、门牌号、小区、楼栋号单元等信息"></textarea></p>
            </div>
            <div class="shoinf-addt-nra">
                <h1>邮政编码：</h1>
                <p><input type="text" placeholder="请填写邮编"></p>
            </div>
            <div class="shoinf-addt-nra">
                <h1><strong>*</strong>姓名：</h1>
                <p><input type="text" placeholder="长度不超过25个字符"></p>
            </div>
            <div class="shoinf-addt-nra">
                <h1><strong>*</strong>手机号码：</h1>
                <p><input type="text" placeholder="请填写手机号码"></p>
            </div>
            <div class="shoinf-addt-nrb">
                <span><button type="button">保存</button></span>
                <p><button type="button" href="javascript:;" class="claseDialogBtn">关闭</button></p>
            </div>
        </div>
    </div>
</div>

<!--==版权==-->
<script type="text/javascript">
    function load_home() {
        document.getElementById("viewDiv").innerHTML = '';
    }
</script>
<object type="text/html" data="/website/copyright" width="100%" height="370px" style="margin-bottom: -5px;"></object>

<!--==返回头部==-->
<script type="text/javascript" src="/website/js/backtop.js"></script>

<!--==省市区==-->
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="/website/js/address/area.js"></script>
<script src="/website/js/address/select.js"></script>

</body>
<script>
    $(function(){
        //选中图标
        $(".medat-nr-lel").find("a").removeClass("hover");
        $(".medat-nr-lel").find("a").eq(3).addClass("hover");
    })
    function addressDel(value){
        layer.confirm('您确定要删除该地址吗?',{btn: ['确定', '取消'],title:"提示"}, function() {
            $.ajax({
                url: '/website/personalData/addressDel',
                data: {'pk': value},
                type: 'get',
                success: function (resp) {
                    layer.msg(resp.message);
                    window.location.reload();
                },
                error: function () {
                    layer.msg("系统错误请联系管理员")
                }
            })
        })
    }
</script>
</html>